/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package aqu.persistencia.entity;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Verito Ramirez
 *         Victor Jaramillo
 */
@Entity
@Table(name = "cxp_proveedor")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "CxpProveedor.findAll", query = "SELECT s FROM CxpProveedor s"),
    @NamedQuery(name = "CxpProveedor.findBycxpCodigoPro", query = "SELECT s FROM CxpProveedor s WHERE s.cxpCodigoPro = :cxpCodigoPro"),
    @NamedQuery(name = "CxpProveedor.findBycxpRucPro", query = "SELECT s FROM CxpProveedor s WHERE s.cxpRucPro = :cxpRucPro"),
    @NamedQuery(name = "CxpProveedor.findBycxpNombrePro", query = "SELECT s FROM CxpProveedor s WHERE s.cxpNombrePro = :cxpNombrePro"),
    @NamedQuery(name = "CxpProveedor.findBycxpDireccionPro", query = "SELECT s FROM CxpProveedor s WHERE s.cxpDireccionPro = :cxpDireccionPro"),
    @NamedQuery(name = "CxpProveedor.findBycxpTelefonoPro", query = "SELECT s FROM CxpProveedor s WHERE s.cxpTelefonoPro = :cxpTelefonoPro"),
    @NamedQuery(name = "CxpProveedor.findBycxpEmailPro", query = "SELECT s FROM CxpProveedor s WHERE s.cxpEmailPro = :cxpEmailPro"),    
    @NamedQuery(name = "CxpProveedor.findBycxpAutorizacionPro", query = "SELECT s FROM CxpProveedor s WHERE s.cxpAutorizacionPro = :cxpAutorizacionPro"),    
    @NamedQuery(name = "CxpProveedor.findBycxpSeriePro", query = "SELECT s FROM CxpProveedor s WHERE s.cxpSeriePro = :cxpSeriePro"),    
    @NamedQuery(name = "CxpProveedor.findByconCodigoCue", query = "SELECT s FROM CxpProveedor s WHERE s.conCodigoCue = :conCodigoCue"),
    @NamedQuery(name = "CxpProveedor.findBycxpCodigoTipCon", query = "SELECT s FROM CxpProveedor s WHERE s.cxpCodigoTipCon = :cxpCodigoTipCon")})
public class CxpProveedor implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @NotNull
    @Size(min = 1, max = 10)
    @Column(name = "CXP_CODIGO_PRO")
    private String cxpCodigoPro;
    @Size(max = 13)
    @Column(name = "CXP_RUC_PRO")
    private String cxpRucPro;
    @Size(max = 50)
    @Column(name = "CXP_NOMBRE_PRO")
    private String cxpNombrePro; 
    @Size(max = 250)
    @Column(name = "CXP_DIRECCION_PRO")
    private String cxpDireccionPro;
    @Size(max = 45)
    @Column(name = "CXP_TELEFONO_PRO")
    private String cxpTelefonoPro;
    @Size(max = 45)
    @Column(name = "CXP_EMAIL_PRO")
    private String cxpEmailPro;    
    @Size(min = 1, max = 25)
    @Column(name = "CON_CODIGO_CUE")
    private String conCodigoCue;
    @Size(min = 1, max = 13)
    @Column(name = "CXP_AUTORIZACION_PRO")
    private String cxpAutorizacionPro;
    @Size(min = 1, max = 7)
    @Column(name = "CXP_SERIE_PRO")
    private String cxpSeriePro;
    @Size(min = 1, max = 10)
    @JoinColumn(name = "CXP_CODIGO_TIPCON", referencedColumnName = "CXP_CODIGO_TIPCON")
    @ManyToOne(optional=false)
    private CxpTipoContribuyente cxpCodigoTipCon;

    public CxpProveedor() {
    }

    public CxpProveedor(String cxpCodigoPro, String cxpRucPro, String cxpNombrePro, String cxpDireccionPro, String cxpTelefonoPro, String cxpEmailPro, String conCodigoCue, String cxpAutorizacionPro, String cxpSeriePro, CxpTipoContribuyente cxpCodigoTipCon) {
        this.cxpCodigoPro = cxpCodigoPro;
        this.cxpRucPro = cxpRucPro;
        this.cxpNombrePro = cxpNombrePro;
        this.cxpDireccionPro = cxpDireccionPro;
        this.cxpTelefonoPro = cxpTelefonoPro;
        this.cxpEmailPro = cxpEmailPro;
        this.conCodigoCue = conCodigoCue;
        this.cxpAutorizacionPro = cxpAutorizacionPro;
        this.cxpSeriePro = cxpSeriePro;
        this.cxpCodigoTipCon = cxpCodigoTipCon;
    }
    
    public String getCxpAutorizacionPro() {
        return cxpAutorizacionPro;
    }

    public void setCxpAutorizacionPro(String cxpAutorizacionPro) {
        this.cxpAutorizacionPro = cxpAutorizacionPro;
    }

    public String getCxpSeriePro() {
        return cxpSeriePro;
    }

    public void setCxpSeriePro(String cxpSeriePro) {
        this.cxpSeriePro = cxpSeriePro;
    }

    
    public String getConCodigoCue() {
        return conCodigoCue;
    }

    public void setConCodigoCue(String conCodigoCue) {
        this.conCodigoCue = conCodigoCue;
    }

    public String getCxpCodigoPro() {
        return cxpCodigoPro;
    }

    public void setCxpCodigoPro(String cxpCodigoPro) {
        this.cxpCodigoPro = cxpCodigoPro;
    }

    public CxpTipoContribuyente getCxpCodigoTipCon() {
        return cxpCodigoTipCon;
    }

    public void setCxpCodigoTipCon(CxpTipoContribuyente cxpCodigoTipCon) {
        this.cxpCodigoTipCon = cxpCodigoTipCon;
    }

    public String getCxpDireccionPro() {
        return cxpDireccionPro;
    }

    public void setCxpDireccionPro(String cxpDireccionPro) {
        this.cxpDireccionPro = cxpDireccionPro;
    }

    public String getCxpEmailPro() {
        return cxpEmailPro;
    }

    public void setCxpEmailPro(String cxpEmailPro) {
        this.cxpEmailPro = cxpEmailPro;
    }

    public String getCxpNombrePro() {
        return cxpNombrePro;
    }

    public void setCxpNombrePro(String cxpNombrePro) {
        this.cxpNombrePro = cxpNombrePro;
    }

    public String getCxpRucPro() {
        return cxpRucPro;
    }

    public void setCxpRucPro(String cxpRucPro) {
        this.cxpRucPro = cxpRucPro;
    }

    public String getCxpTelefonoPro() {
        return cxpTelefonoPro;
    }

    public void setCxpTelefonoPro(String cxpTelefonoPro) {
        this.cxpTelefonoPro = cxpTelefonoPro;
    }
    
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (cxpCodigoPro != null ? cxpCodigoPro.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof CxpProveedor)) {
            return false;
        }
        CxpProveedor other = (CxpProveedor) object;
        if ((this.cxpCodigoPro == null && other.cxpCodigoPro != null) || (this.cxpCodigoPro != null && !this.cxpCodigoPro.equals(other.cxpCodigoPro))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "clases.CxpProveedor[ cxpCodigoPro=" + cxpCodigoPro + " ]";
    }
    
}
